<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>视频监控</title>
  
  <style type="text/css">
    html, body {
      width: 100%;
      height: 100%;
      margin: auto;
      overflow: hidden;
      -webkit-user-select: none;
      user-select: none;
    }
    .myplayer {
      width: 95%;
      height: 200px;
      margin: 10px auto 0;
      background-color: #000;
      border-radius: 10px;
    }

    .sub-wnd {
      border-radius: 10px;
    }
  </style>
</head>
<body>
  <div id="play_window" class="myplayer"></div>

  <script src="./h5player.min.js"></script>
  <script>
    //取url中的参数值
    function GetQueryString(name) {
      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
			var r = window.location.search.substr(1).match(reg);
			if (r != null) return unescape(r[2]);
			return null;
    }
    
    // 初始化插件
    var myPlugin = new window.JSPlugin({
        szId: 'play_window', //需要英文字母开头 必填
        szBasePath: './', // 必填,引用H5player.min.js的js相对路径
        iMaxSplit: 1,
        iCurrentSplit:1,
        openDebug: true,
        oStyle: {
          borderSelect: '#FFCC00',
        }
    })

    function play() {
      // 视频流流
      var playURL = GetQueryString("cameraUrl")
      // 窗口下标
      var curIndex = 0;
      // 视频预览
      myPlugin.JS_Play(playURL, {
        playURL,
        mode: 1    // 0 普通模式 / 1 高级模式
      }, curIndex).then((res) => {
        // console.info('JS_Play success');
      }, (err) => {
        // console.info('JS_Play failed:', err);
      });
    }play()
  </script>
</body>
</html>